<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>纯路人博客</title>
    <link rel="icon" th:href="@{/source/favicon.ico}" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="纯路人博客">
    <meta name="description" content="纯路人博客">
    <meta name="author" content="纯路人">
    <link th:href="@{/source/css/bootstrap.min.css}" href="/css/bootstrap.min.css" rel="stylesheet">
    <link th:href="@{/source/css/materialdesignicons.min.css}" href="/css/materialdesignicons.min.css" rel="stylesheet">
    <link th:href="@{/source/css/style.min.css}" href="/css/style.min.css" rel="stylesheet">
</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">

            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <a th:href="@{/index}" href="index.html"><img th:src="@{/source/img/logo-sidebar.png}"
                                                              src="images/logo-sidebar.png"
                                                              title="Kun" alt="Kun"/></a>
            </div>
            <div class="lyear-layout-sidebar-scroll">

                <nav class="sidebar-main">
                    <ul class="nav nav-drawer">
                        <li class="nav-item"><a th:href="@{/index}" href="index.html">
                            返回博客浏览页</a></li>
                    </ul>
                </nav>

                <div class="sidebar-footer">

                </div>
            </div>

        </aside>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">

            <nav class="navbar navbar-default">
                <div class="topbar">

                    <div class="topbar-left">
                        <div class="lyear-aside-toggler">
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                        </div>
                        <span class="navbar-page-title"> 博客详情页 </span>
                    </div>
                </div>
            </nav>

        </header>
        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">
                <h1 style="text-align: center" th:text="${accountAndArticleCnd.getArticle_title()}"></h1>
                <p style="text-align: center; font-size: 15px">
                    博主：<span th:text="${accountAndArticleCnd.getAccount()}"></span>
                    &nbsp;&nbsp;发布时间：<span th:text="${accountAndArticleCnd.getUpload_time()}"></span>
                    &nbsp;&nbsp;浏览量：<span th:text="${accountAndArticleCnd.getArticle_likes()}"></span></p>
                <span style="text-align: center" th:text="${accountAndArticleCnd.getArticle_content()}">
                </span>
            </div>

            <div class="card-body">
                <h2> 评论区：</h2>
                <h5> 我来说两句：</h5>
                <form th:action="@{/addComment}" th:method="post" action="#!" method="post" class="row">
                    <div>
                        <label>
                            <textarea id="comment_content" name="comment_content" cols="60" rows="5"></textarea>
                        </label>
                        <label th:hidden="true">
                            <input id="article_id" name="article_id"
                                  th:value="${accountAndArticleCnd.getArticle_id()}"></input>
                        </label>
                    </div>
                    <div class="form-group col-md-12">
                        <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定
                        </button>
                    </div>
                </form>
                <div class="table-responsive">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>评论编号</th>
                            <th>内容</th>
                            <th>用户</th>
                            <th>上传时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="comments,item:${comments}">
                            <td th:text="${item.count}"></td>
                            <td th:text="${comments.getComment_content()}"></td>
                            <td th:text="${comments.getAccount()}"></td>
                            <td th:text="${comments.getComment_time()}"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <button type="button" class="btn btn-default"
                        onclick="javascript:history.back(-1);return false;">返 回
                </button>
            </div>


        </main>
        <!--End 页面主要内容-->
    </div>
</div>

<script type="text/javascript" th:src="@{/source/js/jquery.min.js}" src="js/jquery.min.js"></script>
<script type="text/javascript" th:src="@{/source/js/bootstrap.min.js}" src="js/bootstrap.min.js"></script>
<script type="text/javascript" th:src="@{/source/js/perfect-scrollbar.min.js}"
        src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" th:src="@{/source/js/main.min.js}" src="js/main.min.js"></script>
<script type="text/javascript">
    $(function () {
        $('.search-bar .dropdown-menu a').click(function () {
            var field = $(this).data('field') || '';
            $('#search-field').val(field);
            $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
        });
    });
</script>
</body>
</html>